home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 8 / The Pier Shareware #8 (The Pier Exchange) (1996).ISO / 051 / ripnum.prg < prev    next >
Text File  |  1995-10-05  |  560b  |  28 lines

  1. **************************************************
  2. * Decimal to MegaNum and UltraNum Converter
  3. * Written by Alan McNamee
  4. * 01/31/95
  5. **************************************************
  6. public RETVAL
  7.  
  8. cstr='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#&'
  9.  
  10. do ripnum with 4028,4,64
  11. var1=RETVAL
  12. do ripnum with 200,2,36
  13. var2=RETVAL
  14.  
  15.  
  16. *******************
  17. proc ripnum
  18. param value, width, base
  19.  
  20. RETVAL=""
  21. do while width > 0
  22.    width=width-1
  23.    RETVAL=RETVAL+substr(cstr,int(mod(value/(base^width),base))+1,1)
  24. enddo
  25.  
  26. return
  27.  
  28.